#define  _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int main() {
	int nums[] = { 0,1,2,2,3,0,4,2 };
	int numSize = sizeof(nums) / sizeof(nums[0]);
	int val = 0;
	scanf("%d", &val);
	removeElement1(nums, numSize, val);
	return 0;
}
int removeElement(int* nums, int numsSize, int val) {
	int i = 0;
	int count = 0;
	for (i = 0; i < numsSize; i++)
	{
		if (nums[i] == val) {
			nums[i] = -10000000;
			count++;
		}
	}
	printf("%d,", count);
	printf("nums=[");
	for (i = 0; i < numsSize; i++)
	{
		if (nums[i] == -10000000)
		{
			continue;
		}
		printf("%d", nums[i]);
		if ((nums[i] != 0) && (i != numsSize - 2))
		{
			printf(",");
		}
	}
	printf("]");
	return 0;
}

int removeElement1(int* nums, int numsSize, int val) 
{
	int i = 0;
	int count = 0;
	int num = 0;
	for ( i = 0; i < numsSize; i++)
	{
		if(nums[i]==val) {
			count++;
		}
		else
		{
			nums[num] = nums[i];
			num++;
		}
	}
	printf("%d,", count);
	printf("nums=[");
	for (i = 0; i < num; i++)
	{
		
		printf("%d", nums[i]);
		if (i != num - 1)
		{
			printf(",");
		}
	}
	printf("]");
	return count;
}